package com.an.blog.web.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.an.blog.service.IBlogPhotoService;
import com.an.blog.web.domain.vo.BlogPhotoWebVo;
import com.an.common.core.domain.PageQuery;
import com.an.common.core.page.TableDataInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

/**
 * 博客照片web控制器
 *
 * @author: Ann
 * @createDate: 2023/06/26 16:40:07
 * @version: 1.0.0
 */
@RestController
@RequestMapping("/blog-web/photo")
@RequiredArgsConstructor
@Validated
public class BlogPhotoWebController {

    private final IBlogPhotoService photoService;


    /**
     * 查询网站照片网站列表
     *
     * @param albumId   相册id
     * @param pageQuery 页面查询
     * @return {@link TableDataInfo }<{@link BlogPhotoWebVo }>
     * @author: Ann
     * @createDate: 2023/06/26 17:01:24
     * @version: 1.0.0
     */
    @SaIgnore
    @GetMapping("/list")
    public TableDataInfo<BlogPhotoWebVo> queryWebPhotoWebList(@NotNull(message = "相册id不能为空") Long albumId, PageQuery pageQuery) {
        return photoService.queryWebPageList(albumId, pageQuery);
    }

}
